# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WalletObjects.V1.Model.TextModuleData do
  @moduledoc """
  Data for Text module. All fields are optional. Header will be displayed if available, different types of bodies will be concatenated if they are defined.

  ## Attributes

  *   `body` (*type:* `String.t`, *default:* `nil`) - The body of the Text Module, which is defined as an uninterrupted string. Recommended maximum length is 500 characters to ensure full string is displayed on smaller screens.
  *   `header` (*type:* `String.t`, *default:* `nil`) - The header of the Text Module. Recommended maximum length is 35 characters to ensure full string is displayed on smaller screens.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The ID associated with a text module. This field is here to enable ease of management of text modules and referencing them in template overrides. The ID should only include alphanumeric characters, '_', or '-'. It can not include dots, as dots are used to separate fields within FieldReference.fieldPaths in template overrides.
  *   `localizedBody` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - Translated strings for the body. Recommended maximum length is 500 characters to ensure full string is displayed on smaller screens.
  *   `localizedHeader` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - Translated strings for the header. Recommended maximum length is 35 characters to ensure full string is displayed on smaller screens.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :body => String.t() | nil,
          :header => String.t() | nil,
          :id => String.t() | nil,
          :localizedBody => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil,
          :localizedHeader => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil
        }

  field(:body)
  field(:header)
  field(:id)
  field(:localizedBody, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
  field(:localizedHeader, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
end

defimpl Poison.Decoder, for: GoogleApi.WalletObjects.V1.Model.TextModuleData do
  def decode(value, options) do
    GoogleApi.WalletObjects.V1.Model.TextModuleData.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WalletObjects.V1.Model.TextModuleData do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
